/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testing;

import org.mockito.Mockito;
import java.util.List;

public class MockitoDemo3 {

    public static void main(String[] args) {
        // arrange
        List<String> listMock = Mockito.mock(List.class);
        Mockito.when(listMock.get(0)).thenReturn("stub");
        Mockito.when(listMock.get(Mockito.anyInt())).thenReturn("yana");
        // act
        System.out.println(listMock.get(0));
        System.out.println(listMock.get(1));
    }
}


